package com.lyx.service;

import com.lyx.domain.Role;
import com.lyx.domain.UserInfo;
import org.springframework.security.core.userdetails.UserDetailsService;

import java.util.List;

public interface IUserService extends UserDetailsService {

    //查询所有用户
    List<UserInfo> findAll() throws Exception;

    //保存用户
    void save(UserInfo userInfo) throws Exception;

    //通过用户id查询用户
    UserInfo findById(String id) throws Exception;

    //查询用户没有添加的角色
    List<Role> findOtherRoles(String userId) throws Exception;

    //为用户添加角色
    void addRoleToUser(String userId, String[] roleIds);
}
